{template 'common/header'}
{template 'public/comhead'}
<ul class="nav nav-tabs">
    <li class="active"><a href="#">平台设置</a></li>
</ul>
 {if $operation == 'post'}   
<div class="main">
	<form action="" method="post" class="form-horizontal form"	enctype="multipart/form-data">
		<div class="panel panel-default">
		    <div class="alert alert-success">
                温馨提示:</br>
				更多平台化设置方法，请参看微教育商业用户群平台功能商业化运营指南
            </div>		
			<div class="panel-heading">	
				<div class="row-fluid">
					<div class="span8 control-group">
						<a class="btn btn-default" href="{php echo $this->createWebUrl('banners', array('op' => 'display' ))}"><i class="fa fa-search"></i>幻灯片</a>
						<a class="btn {if $operation == 'post'}btn-primary {else}btn-default"{/if} href="{php echo $this->createWebUrl('banners', array('op' => 'post' ))}"><i class="fa fa-edit"></i>添加幻灯片</a>
					</div>
				</div>
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">排序</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="displayorder" class="form-control" value="{$banner['displayorder']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>幻灯片标题</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="bannername" class="form-control" value="{$banner['bannername']}" />
					</div>
				</div>

				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">幻灯片图片</label>
					<div class="col-sm-9 col-xs-12">
						{php echo tpl_form_field_image('thumb', $banner['thumb'])}

					<div class="help-block">图片最大高度为600，每张图片宽高请设置为相同的宽高！！！</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>幻灯片链接</label>
					<div class="col-sm-9 col-xs-12">
						<input type="text" name="link" class="form-control" value="{$banner['link']}" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">显示时间</label>
                   <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label" style="width: 100px;">开始时间:</label>
                     <div class="col-sm-2 col-lg-2">
				        <div class="input-group">
				     {php echo tpl_form_field_date('begintime', date('Y-m-d', $banner['begintime']))}	
                        </div>
				     </div>
                   <label class="col-xs-12 col-sm-2 col-md-2 col-lg-2 control-label" style="width: 100px;">结束时间:</label>
                     <div class="col-sm-2 col-lg-2">
				        <div class="input-group">
				     {php echo tpl_form_field_date('endtime', date('Y-m-d', $banner['endtime']))}	
                        </div>
				     </div>					 
                </div>
				<div class="form-group">
					<label class="col-xs-12 col-sm-2 col-md-2  control-label text-danger">选择学校</label>
					<div class="col-sm-9 col-xs-6">
						<div class="input-group text-info">
							{loop $school $uni}
							
							{php $is = $this->uniarr($uniarr,$uni['id']);}
									<label for="uni_{$uni['id']}" class="checkbox-inline"><input id="uni_{$uni['id']}" type="checkbox" name="arr[]" value="{$uni['id']}"{if ($is)}checked="checked"{/if}> {$uni['title']}</label>
							{/loop}
						</div>
						<div class="help-block">选择要将此幻灯片展示的学校,可多选</div>
					</div>
				</div>				
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label">是否显示</label>
					<div class="col-sm-9 col-xs-12">
						<label class='radio-inline'>
							<input type='radio' name='enabled' value=1' {if $banner['enabled']==1}checked{/if} /> 是
						</label>
						<label class='radio-inline'>
							<input type='radio' name='enabled' value=0' {if $banner['enabled']==0}checked{/if} /> 否
						</label>
					</div>
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>
{elseif $operation == 'display'}
<div class="main">
	
		<div class="panel panel-default">
		    <div class="alert alert-success">
                温馨提示:</br>
				更多平台化设置方法，请参看微教育商业用户群平台功能商业化运营指南
            </div>	
            <div class="row">
                <ul class="nav nav-pills" role="tablist">
                    <li {if ($_GPC['do'] == 'fenzu')}class="active"{/if}>
                        <a href="{php echo $this->createWebUrl('fenzu', array('op' => 'display'))}">分组管理</a>
					</li>	
                    <li {if ($_GPC['do'] == 'manager')}class="active"{/if}>
                        <a href="{php echo $this->createWebUrl('manager', array('op' => 'display'))}">二维码管理</a>
                    </li>
                    <li {if ($_GPC['do'] == 'banners')}class="active"{/if}>
                        <a href="{php echo $this->createWebUrl('banners', array('op' => 'display'))}">平台幻灯片</a>
                    </li>	
                    <li {if ($_GPC['do'] == 'comad')}class="active"{/if}>
                        <a href="{php echo $this->createWebUrl('comad', array('op' => 'display'))}">贴片广告</a>
                    </li>	
                    <li {if ($_GPC['do'] == 'comload')}class="active"{/if}>
                        <a href="{php echo $this->createWebUrl('comload', array('op' => 'display'))}">公共加载</a>
                    </li>					
                </ul>
            </div>			
			<div class="panel-heading">	
				<div class="row-fluid">
					<div class="span8 control-group">
						<a class="btn {if $operation == 'post'}btn-primary {else}btn-default"{/if} href="{php echo $this->createWebUrl('banners', array('op' => 'post' ))}"><i class="fa fa-edit"></i>添加幻灯片</a>
					</div>
				</div>
			</div>
			<form method="post" class="form-horizontal" id="formfans">
			<input type="hidden" name="op" value="del" />
			<div style="position:relative">
				<div class="panel-body table-responsive">
					<table class="table table-hover" style="position:relative">
					<thead class="navbar-inner">
						<tr>
							<th style="width:30px;">ID</th>
									<th>显示顺序</th>					
									<th>标题</th>
									<th>预览</th>
									<th>连接</th>
									<th>状态</th>
									<th>时间</th>
									<th >操作</th>
						</tr>
					</thead>
					<tbody>
						{loop $list $banner}
							<tr>
								<td>{$banner['id']}</td>
								<td>{$banner['displayorder']}</td>
								<td>{$banner['bannername']}</td>
								<td><img src="{php echo tomedia($banner['thumb'])}" width="50"></td>
								<td>{$banner['link']}</td>
								<td>{if $banner['enabled']}显示{else}隐藏{/if}</td>
								<td>{php echo date('Y-m-d',$banner['begintime'])}至{php echo date('Y-m-d',$banner['endtime'])}</td>
								<td style="text-align:left;">
									<a href="{php echo $this->createWebUrl('banners', array('op' => 'post', 'id' => $banner['id']))}" data-toggle="tooltip" data-placement="top"  class="btn btn-default btn-sm manage"><i class="fa fa-edit"></i>修改</a>
									<a href="{php echo $this->createWebUrl('banners', array('op' => 'delete', 'id' => $banner['id']))}" data-toggle="tooltip" data-placement="top"  class="btn btn-default btn-sm manage"><i class="fa fa-del"></i>删除</a> 
								</td>
							</tr>
						{/loop}
						
					</tbody>
					</table>
				</div>
			</div>
			</form>
			{$pager}
		</div>
    </div>
{/if}
{template 'common/footer'}